/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package exatrez.model;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author fikri
 */
@Entity
@Table(name = "observation_history_task")
@NamedQueries({
    @NamedQuery(name = "ObservationHistoryTask.findAll", query = "SELECT o FROM ObservationHistoryTask o")})
public class ObservationHistoryTask implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "obs_history_task")
    private Integer obsHistoryTask;
    
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "observation_task_id")
    private ObservationTask observationTask;
    
    @Column(name = "action_plan_summary")
    private String actionPlanSummary;
    
    @Column(name = "remarks")
    private String remarks;
    
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "status_remarks")
    private StatusRemarkCode statusRemarks;
    
    @Column(name = "response_date")
    @Temporal(TemporalType.TIMESTAMP)
    private Date responseDate;
    
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "folder_id")
    private Folder folder;

    public ObservationHistoryTask() {
    }

    public ObservationHistoryTask(Integer obsHistoryTask) {
        this.obsHistoryTask = obsHistoryTask;
    }

    public Integer getObsHistoryTask() {
        return obsHistoryTask;
    }

    public void setObsHistoryTask(Integer obsHistoryTask) {
        this.obsHistoryTask = obsHistoryTask;
    }

    public ObservationTask getObservationTask() {
        return observationTask;
    }

    public void setObservationTask(ObservationTask observationTask) {
        this.observationTask = observationTask;
    }

    public String getActionPlanSummary() {
        return actionPlanSummary;
    }

    public void setActionPlanSummary(String actionPlanSummary) {
        this.actionPlanSummary = actionPlanSummary;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public Date getResponseDate() {
        return responseDate;
    }

    public void setResponseDate(Date responseDate) {
        this.responseDate = responseDate;
    }

    public StatusRemarkCode getStatusRemarks() {
        return statusRemarks;
    }

    public void setStatusRemarks(StatusRemarkCode statusRemarks) {
        this.statusRemarks = statusRemarks;
    }

    public Folder getFolder() {
        return folder;
    }

    public void setFolder(Folder folder) {
        this.folder = folder;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (obsHistoryTask != null ? obsHistoryTask.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ObservationHistoryTask)) {
            return false;
        }
        ObservationHistoryTask other = (ObservationHistoryTask) object;
        if ((this.obsHistoryTask == null && other.obsHistoryTask != null) || (this.obsHistoryTask != null && !this.obsHistoryTask.equals(other.obsHistoryTask))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "exatrez.model.ObservationHistoryTask[ obsHistoryTask=" + obsHistoryTask + " ]";
    }
    
}
